package cn.mw.cmdb.template.enums;

/**
 * @author gengjb
 * @description 触发器等级枚举
 * @date 2024/7/30 11:36
 */
public enum TriggerLevelEnum {
    UNCLASSIFIED("0","未分类"),
    INFO("1","信息"),
    WARN("2","警告"),
    SAMEAS_WORSE("3","一般严重"),
    WORSE("4","严重"),
    DISASTER("5","灾难"),
    ;

    private String type;

    private String name;

    TriggerLevelEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static TriggerLevelEnum getTriggerLevelEnum(String type) {
        for (TriggerLevelEnum triggerLevelEnum : values()) {
            if (type.equals(triggerLevelEnum.getType())) {
                return triggerLevelEnum;
            }
        }
        return null;
    }
}
